package com.core.ui.controller.base;

import java.io.Serializable;
import java.util.List;

import com.core.protocols.IServiceLayerDelegate;
import com.core.servicelayer.HibernateServiceLayer;
import com.core.ui.controller.DetailController;
import com.core.utils.RecordState;


public class HibernateDetailController
        extends DetailController
        implements IServiceLayerDelegate {

	private RecordState.Mode editMode = RecordState.Mode.NONE;



	public boolean isReadOnly () {

		boolean result = true;
		result = !(editMode == RecordState.Mode.EDIT || editMode == RecordState.Mode.ADD);
		return result;

	}



	public RecordState.Mode getEditMode () {

		return editMode;
	}



	public void setEditMode ( RecordState.Mode editMode ) {

		this.editMode = editMode;
	}



	public void setEditMode ( String editMode ) {

		this.editMode = RecordState.Mode.valueOf(editMode);
	}



	@Override
	public <T> void responseResponseItemsList ( final List <T> items,
	                                            final Object request,
	                                            final Exception exception ) {

	}



	protected void performDetailRequest ( Class <HibernateServiceLayer> layerClass,
	                                      Serializable userInfo,
	                                      String filter ) {

	}
}
